package cn.rxmind.dlicense.core.utils;

import cn.rxmind.dlicense.core.exception.DLicenseErrEnum;
import cn.rxmind.dlicense.core.exception.DLicenseExceptionFactory;

/**
 * 断言工具
 *
 * @author renxin
 * @email renxinzhiliangzhi@163.com
 * @date 2021/4/14 10:53 上午
 */
public class AssertUtil {

    public static void assertTrue(boolean shouldTrue, String message){

        if(!shouldTrue){
            throw DLicenseExceptionFactory.buildUtryLicenseException(DLicenseErrEnum.PARAMETER_ILLEGAL,message);
        }
    }

    public static void assertFalse(boolean shouldFalse, String message){
        assertTrue(!shouldFalse,message);
    }

}
